
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: room</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>room</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)</font></td></tr></table>
    <p><tt>Contains&nbsp;the&nbsp;Python&nbsp;wrapper&nbsp;for&nbsp;rooms,&nbsp;and&nbsp;utilities&nbsp;for&nbsp;loading&nbsp;and<br>
instancing&nbsp;rooms.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="room.html#Room">Room</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Room">class <strong>Room</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#Room-__init__">__init__</a>(self,&nbsp;uid_or_string_key)<br>
&nbsp;<br>
Creates&nbsp;a&nbsp;new&nbsp;Python&nbsp;reference&nbsp;to&nbsp;a&nbsp;room,&nbsp;by&nbsp;uid.&nbsp;If&nbsp;a&nbsp;string&nbsp;database<br>
key&nbsp;is&nbsp;instead&nbsp;supplied,&nbsp;first&nbsp;try&nbsp;to&nbsp;generate&nbsp;a&nbsp;room&nbsp;by&nbsp;an&nbsp;rporoto&nbsp;of<br>
the&nbsp;same&nbsp;name.&nbsp;If&nbsp;no&nbsp;rproto&nbsp;exists,&nbsp;create&nbsp;a&nbsp;new&nbsp;blank&nbsp;room&nbsp;in&nbsp;the&nbsp;room<br>
table,&nbsp;and&nbsp;assign&nbsp;it&nbsp;the&nbsp;given&nbsp;key.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Room-__cmp__"><strong>__cmp__</strong></a>(...)</dt><dd><tt>x.<a href="#Room-__cmp__">__cmp__</a>(y)&nbsp;&lt;==&gt;&nbsp;cmp(x,y)</tt></dd></dl>

<dl><dt><a name="Room-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#Room-__hash__">__hash__</a>()&nbsp;&lt;==&gt;&nbsp;hash(x)</tt></dd></dl>

<dl><dt><a name="Room-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Room-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;x.__class__.__doc__&nbsp;for&nbsp;signature</tt></dd></dl>

<dl><dt><a name="Room-add_cmd"><strong>add_cmd</strong></a>(...)</dt><dd><tt><a href="#Room-add_cmd">add_cmd</a>(name,&nbsp;shorthand,&nbsp;cmd_func,&nbsp;user_group,&nbsp;interrupts&nbsp;=&nbsp;False)<br>
&nbsp;<br>
Add&nbsp;a&nbsp;new&nbsp;player&nbsp;command&nbsp;specific&nbsp;to&nbsp;the&nbsp;room.&nbsp;See&nbsp;mudsys.add_cmd&nbsp;for<br>
documentation&nbsp;on&nbsp;commands.</tt></dd></dl>

<dl><dt><a name="Room-add_cmd_check"><strong>add_cmd_check</strong></a>(...)</dt><dd><tt><a href="#Room-add_cmd_check">add_cmd_check</a>(cmd_name,&nbsp;check_func)<br>
&nbsp;<br>
Add&nbsp;a&nbsp;new&nbsp;command&nbsp;check&nbsp;function&nbsp;specific&nbsp;to&nbsp;the&nbsp;room.&nbsp;See&nbsp;<br>
mudsys.add_cmd_check&nbsp;for&nbsp;documentation&nbsp;on&nbsp;command&nbsp;checks.</tt></dd></dl>

<dl><dt><a name="Room-attach"><strong>attach</strong></a>(...)</dt><dd><tt><a href="#Room-attach">attach</a>(trigger)<br>
&nbsp;<br>
Attach&nbsp;a&nbsp;trigger&nbsp;to&nbsp;the&nbsp;room&nbsp;by&nbsp;key&nbsp;name.</tt></dd></dl>

<dl><dt><a name="Room-aux"><strong>aux</strong></a>(...)</dt><dd><tt>Alias&nbsp;for&nbsp;room.<a href="#Room">Room</a>.<a href="#Room-getAuxiliary">getAuxiliary</a>(name)</tt></dd></dl>

<dl><dt><a name="Room-deletevar"><strong>deletevar</strong></a>(...)</dt><dd><tt><a href="#Room-deletevar">deletevar</a>(name)<br>
&nbsp;<br>
Deletes&nbsp;a&nbsp;special&nbsp;variable&nbsp;from&nbsp;a&nbsp;room&nbsp;if&nbsp;they&nbsp;have&nbsp;one&nbsp;by&nbsp;the<br>
given&nbsp;name.</tt></dd></dl>

<dl><dt><a name="Room-delvar"><strong>delvar</strong></a>(...)</dt><dd><tt>Alias&nbsp;for&nbsp;room.<a href="#Room">Room</a>.<a href="#Room-deletevar">deletevar</a>(name)</tt></dd></dl>

<dl><dt><a name="Room-detach"><strong>detach</strong></a>(...)</dt><dd><tt><a href="#Room-detach">detach</a>(trigger)<br>
&nbsp;<br>
Detach&nbsp;a&nbsp;trigger&nbsp;from&nbsp;the&nbsp;room&nbsp;by&nbsp;key&nbsp;name.</tt></dd></dl>

<dl><dt><a name="Room-dig"><strong>dig</strong></a>(...)</dt><dd><tt><a href="#Room-dig">dig</a>(dir,&nbsp;dest)<br>
&nbsp;<br>
Link&nbsp;the&nbsp;room&nbsp;to&nbsp;another&nbsp;room&nbsp;via&nbsp;the&nbsp;specified&nbsp;direction.&nbsp;The<br>
destination&nbsp;room&nbsp;can&nbsp;be&nbsp;an&nbsp;actual&nbsp;room&nbsp;or&nbsp;a&nbsp;room&nbsp;key&nbsp;name.&nbsp;Returns<br>
the&nbsp;created&nbsp;exit.&nbsp;If&nbsp;an&nbsp;exit&nbsp;already&nbsp;exists&nbsp;in&nbsp;the&nbsp;specified<br>
direction,&nbsp;change&nbsp;its&nbsp;destination.</tt></dd></dl>

<dl><dt><a name="Room-do_trigs"><strong>do_trigs</strong></a>(...)</dt><dd><tt><a href="#Room-do_trigs">do_trigs</a>(type,&nbsp;ch=None,&nbsp;obj=None,&nbsp;room=None,&nbsp;exit=None,&nbsp;cmd=None,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arg=None,&nbsp;opts=None)<br>
&nbsp;<br>
Run&nbsp;triggers&nbsp;of&nbsp;the&nbsp;specified&nbsp;type&nbsp;on&nbsp;the&nbsp;room.&nbsp;By&nbsp;default,&nbsp;the<br>
trigger&nbsp;owner&nbsp;is&nbsp;'me'.&nbsp;Other&nbsp;variables&nbsp;can&nbsp;be&nbsp;specified.&nbsp;The&nbsp;opts<br>
variable&nbsp;can&nbsp;be&nbsp;a&nbsp;dictionary&nbsp;that&nbsp;maps&nbsp;optional&nbsp;variable&nbsp;names&nbsp;to&nbsp;their<br>
values.</tt></dd></dl>

<dl><dt><a name="Room-edesc"><strong>edesc</strong></a>(...)</dt><dd><tt><a href="#Room-edesc">edesc</a>(keywords,&nbsp;desc)<br>
&nbsp;<br>
Create&nbsp;an&nbsp;extra&nbsp;description&nbsp;for&nbsp;the&nbsp;room,&nbsp;accessible&nbsp;via&nbsp;a&nbsp;comma-<br>
separated&nbsp;list&nbsp;of&nbsp;keywords.</tt></dd></dl>

<dl><dt><a name="Room-exdir"><strong>exdir</strong></a>(...)</dt><dd><tt><a href="#Room-exdir">exdir</a>(exit)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;direction&nbsp;for&nbsp;a&nbsp;specified&nbsp;exit,&nbsp;or&nbsp;None.</tt></dd></dl>

<dl><dt><a name="Room-exit"><strong>exit</strong></a>(...)</dt><dd><tt><a href="#Room-exit">exit</a>(dir)<br>
&nbsp;<br>
Returns&nbsp;an&nbsp;exit&nbsp;for&nbsp;the&nbsp;specified&nbsp;direction,&nbsp;or&nbsp;None.</tt></dd></dl>

<dl><dt><a name="Room-fill"><strong>fill</strong></a>(...)</dt><dd><tt><a href="#Room-fill">fill</a>(dir)<br>
&nbsp;<br>
Erases&nbsp;an&nbsp;exit&nbsp;in&nbsp;the&nbsp;specified&nbsp;direction.</tt></dd></dl>

<dl><dt><a name="Room-getAuxiliary"><strong>getAuxiliary</strong></a>(...)</dt><dd><tt><a href="#Room-getAuxiliary">getAuxiliary</a>(name)<br>
&nbsp;<br>
Returns&nbsp;room's&nbsp;auxiliary&nbsp;data&nbsp;of&nbsp;the&nbsp;specified&nbsp;name.</tt></dd></dl>

<dl><dt><a name="Room-getvar"><strong>getvar</strong></a>(...)</dt><dd><tt><a href="#Room-getvar">getvar</a>(name)<br>
&nbsp;<br>
Return&nbsp;value&nbsp;of&nbsp;a&nbsp;special&nbsp;variable.&nbsp;Return&nbsp;0&nbsp;if&nbsp;no&nbsp;value&nbsp;has&nbsp;been&nbsp;set.</tt></dd></dl>

<dl><dt><a name="Room-hasBit"><strong>hasBit</strong></a>(...)</dt><dd><tt><a href="#Room-hasBit">hasBit</a>(name)<br>
&nbsp;<br>
Return&nbsp;whether&nbsp;room&nbsp;has&nbsp;a&nbsp;bit&nbsp;toggled.</tt></dd></dl>

<dl><dt><a name="Room-hasvar"><strong>hasvar</strong></a>(...)</dt><dd><tt><a href="#Room-hasvar">hasvar</a>(name)<br>
&nbsp;<br>
Return&nbsp;True&nbsp;if&nbsp;a&nbsp;room&nbsp;has&nbsp;the&nbsp;given&nbsp;special&nbsp;variable.&nbsp;False&nbsp;otherwise.</tt></dd></dl>

<dl><dt><a name="Room-isinstance"><strong>isinstance</strong></a>(...)</dt><dd><tt><a href="#Room-isinstance">isinstance</a>(prototype)<br>
&nbsp;<br>
returns&nbsp;whether&nbsp;the&nbsp;room&nbsp;inherits&nbsp;from&nbsp;a&nbsp;specified&nbsp;room&nbsp;prototype.</tt></dd></dl>

<dl><dt><a name="Room-reset"><strong>reset</strong></a>(...)</dt><dd><tt><a href="#Room-reset">reset</a>()<br>
&nbsp;<br>
Runs&nbsp;a&nbsp;room's&nbsp;reset&nbsp;commands&nbsp;and&nbsp;reset&nbsp;hooks.</tt></dd></dl>

<dl><dt><a name="Room-send"><strong>send</strong></a>(...)</dt><dd><tt><a href="#Room-send">send</a>(mssg)<br>
&nbsp;<br>
Send&nbsp;a&nbsp;message&nbsp;to&nbsp;all&nbsp;characters&nbsp;in&nbsp;the&nbsp;room.</tt></dd></dl>

<dl><dt><a name="Room-setvar"><strong>setvar</strong></a>(...)</dt><dd><tt><a href="#Room-setvar">setvar</a>(name,&nbsp;val)<br>
&nbsp;<br>
Set&nbsp;value&nbsp;of&nbsp;a&nbsp;special&nbsp;variable&nbsp;for&nbsp;the&nbsp;room.&nbsp;Values&nbsp;must&nbsp;be&nbsp;strings&nbsp;<br>
or&nbsp;numbers.&nbsp;This&nbsp;function&nbsp;is&nbsp;intended&nbsp;to&nbsp;allow&nbsp;scripts&nbsp;and&nbsp;triggers&nbsp;toopen-endedly&nbsp;add&nbsp;variables&nbsp;to&nbsp;rooms.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>bits</strong></dt>
<dd><tt>A&nbsp;comma-separated&nbsp;list&nbsp;of&nbsp;setting&nbsp;bits&nbsp;currently&nbsp;toggled&nbsp;on&nbsp;the&nbsp;room.</tt></dd>
</dl>
<dl><dt><strong>chars</strong></dt>
<dd><tt>A&nbsp;list&nbsp;of&nbsp;all&nbsp;characters&nbsp;in&nbsp;the&nbsp;room.&nbsp;Immutable.&nbsp;See&nbsp;char.Char.room<br>
for&nbsp;changing&nbsp;the&nbsp;room&nbsp;a&nbsp;character&nbsp;is&nbsp;in.</tt></dd>
</dl>
<dl><dt><strong>contents</strong></dt>
<dd><tt>A&nbsp;list&nbsp;of&nbsp;objects&nbsp;in&nbsp;the&nbsp;room.&nbsp;Immutable.&nbsp;See&nbsp;obj.Obj.room&nbsp;for<br>
changing&nbsp;the&nbsp;room&nbsp;an&nbsp;object&nbsp;is&nbsp;in.</tt></dd>
</dl>
<dl><dt><strong>desc</strong></dt>
<dd><tt>The&nbsp;room's&nbsp;description&nbsp;when,&nbsp;e.g.,&nbsp;looked&nbsp;at.</tt></dd>
</dl>
<dl><dt><strong>exnames</strong></dt>
<dd><tt>A&nbsp;list&nbsp;of&nbsp;the&nbsp;room's&nbsp;exits,&nbsp;by&nbsp;direction.&nbsp;Immutable.&nbsp;See&nbsp;room.Room.dig<br>
for&nbsp;creating&nbsp;new&nbsp;links&nbsp;between&nbsp;rooms.</tt></dd>
</dl>
<dl><dt><strong>locale</strong></dt>
<dd><tt>The&nbsp;zone&nbsp;a&nbsp;room&nbsp;belongs&nbsp;to.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>name</strong></dt>
<dd><tt>The&nbsp;room's&nbsp;name,&nbsp;e.g.,&nbsp;Town&nbsp;Square.</tt></dd>
</dl>
<dl><dt><strong>objs</strong></dt>
<dd><tt>Alias&nbsp;for&nbsp;room.Room.contents</tt></dd>
</dl>
<dl><dt><strong>proto</strong></dt>
<dd><tt>The&nbsp;room's&nbsp;unique&nbsp;identifier&nbsp;key.&nbsp;For&nbsp;non-instanced&nbsp;rooms,&nbsp;equivalent<br>
to&nbsp;the&nbsp;main&nbsp;room&nbsp;prototype&nbsp;inherited&nbsp;from.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>protoname</strong></dt>
<dd><tt>The&nbsp;first&nbsp;half&nbsp;of&nbsp;the&nbsp;room's&nbsp;unique&nbsp;identifier&nbsp;key.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>protos</strong></dt>
<dd><tt>A&nbsp;comma-separated&nbsp;list&nbsp;of&nbsp;room&nbsp;prototypes&nbsp;this&nbsp;room&nbsp;inherits&nbsp;from.&nbsp;Immutable.</tt></dd>
</dl>
<dl><dt><strong>terrain</strong></dt>
<dd><tt>The&nbsp;current&nbsp;terrain&nbsp;type&nbsp;of&nbsp;the&nbsp;room.</tt></dd>
</dl>
<dl><dt><strong>uid</strong></dt>
<dd><tt>The&nbsp;room's&nbsp;unique&nbsp;identification&nbsp;number.&nbsp;Immutable.</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object at 0x6f680&gt;<dd><tt>T.<a href="#Room-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-get_room"><strong>get_room</strong></a>(...)</dt><dd><tt><a href="#-get_room">get_room</a>(key)<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;room&nbsp;key/locale&nbsp;and&nbsp;returns&nbsp;the&nbsp;matching&nbsp;room,&nbsp;or&nbsp;None.</tt></dd></dl>
 <dl><dt><a name="-instance"><strong>instance</strong></a>(...)</dt><dd><tt><a href="#-instance">instance</a>(room_proto,&nbsp;as_key&nbsp;=&nbsp;None)<br>
&nbsp;<br>
Create&nbsp;an&nbsp;instanced&nbsp;copy&nbsp;of&nbsp;a&nbsp;room,&nbsp;specified&nbsp;by&nbsp;a&nbsp;room&nbsp;prototype&nbsp;name.<br>
If&nbsp;as_key&nbsp;is&nbsp;None,&nbsp;the&nbsp;instanced&nbsp;room's&nbsp;key&nbsp;will&nbsp;be&nbsp;a&nbsp;derivation&nbsp;of<br>
the&nbsp;original&nbsp;prototype&nbsp;name,&nbsp;with&nbsp;a&nbsp;uid&nbsp;number&nbsp;appended&nbsp;to&nbsp;it.&nbsp;Otherwise<br>
as_key&nbsp;is&nbsp;used&nbsp;for&nbsp;the&nbsp;room's&nbsp;key.</tt></dd></dl>
 <dl><dt><a name="-is_abstract"><strong>is_abstract</strong></a>(...)</dt><dd><tt><a href="#-is_abstract">is_abstract</a>(proto)<br>
&nbsp;<br>
Returns&nbsp;whether&nbsp;a&nbsp;specified&nbsp;room&nbsp;prototype&nbsp;is&nbsp;abstract.&nbsp;Also&nbsp;return&nbsp;True<br>
if&nbsp;the&nbsp;prototype&nbsp;does&nbsp;not&nbsp;exist.</tt></dd></dl>
 <dl><dt><a name="-is_loaded"><strong>is_loaded</strong></a>(...)</dt><dd><tt><a href="#-is_loaded">is_loaded</a>(key)<br>
&nbsp;<br>
Returns&nbsp;whether&nbsp;a&nbsp;room&nbsp;with&nbsp;the&nbsp;given&nbsp;key&nbsp;currently&nbsp;exists&nbsp;in&nbsp;game.</tt></dd></dl>
</td></tr></table>
</body></html>